# vim: filetype=yaml sw=2
filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
version: 85.4.0
git_hash: b9601a76c7d47aa54c60b81c783571630d4962bf
git_url: https://github.com/mozilla/application-services
git_submodule: 1

var:
  container:
    use_container: 1
  # This should be updated when the list of gradle dependencies is changed.
  gradle_dependencies_version: 7
  gradle_version: 6.7.1
  glean_parser: 3.4.0
  arch_deps:
    - python3-venv

input_files:
  - project: container-image
    pkg_type: build
  - project: '[% c("var/compiler") %]'
    name: '[% c("var/compiler") %]'
    pkg_type: build
  - project: gradle
    name: gradle
    pkg_type: build
  - project: rust
    name: rust
    pkg_type: build
  - project: uniffi-rs
    name: uniffi-rs
    pkg_type: build
  - project: nss
    name: nss-armv7
    pkg_type: build
    target_prepend:
      - android-armv7
  - project: nss
    name: nss-aarch64
    pkg_type: build
    target_prepend:
      - android-aarch64
  - project: nss
    name: nss-x86
    pkg_type: build
    target_prepend:
      - android-x86
  - project: nss
    name: nss-x86_64
    pkg_type: build
    target_prepend:
      - android-x86_64
  - project: nss
    name: nss-linux-x86_64
    pkg_type: build
    target_prepend:
      - nss-linux-x86_64
  - project: sqlcipher
    name: sqlcipher-armv7
    pkg_type: build
    target_prepend:
      - android-armv7
  - project: sqlcipher
    name: sqlcipher-aarch64
    pkg_type: build
    target_prepend:
      - android-aarch64
  - project: sqlcipher
    name: sqlcipher-x86
    pkg_type: build
    target_prepend:
      - android-x86
  - project: sqlcipher
    name: sqlcipher-x86_64
    pkg_type: build
    target_prepend:
      - android-x86_64
  - project: sqlcipher
    name: sqlcipher-linux-x86_64
    pkg_type: build
    target_prepend:
      - sqlcipher-linux-x86_64
      - nss-linux-x86_64
  - filename: 'gradle-dependencies-[% c("var/gradle_dependencies_version") %]'
    name: gradle-dependencies
    exec: '[% INCLUDE "fetch-gradle-dependencies" %]'
    enable: '[% !c("var/fetch_gradle_dependencies") %]'
  - URL: '[% pc("glean", "var/glean_wheels_url/" _ c("var/glean_parser"), { error_if_undef => 1 }) %]'
    name: glean-wheels
    sha256sum: '[% pc("glean", "var/glean_wheels_sha256sum/" _ c("var/glean_parser"), { error_if_undef => 1 }) %]'
    enable: '[% !c("var/fetch_gradle_dependencies") %]'
  # Use `make cargo_vendor-application-services` to re-generate the vendor tarball
  - URL: https://people.torproject.org/~boklm/mirrors/sources/application-services-vendor-[% c('version') %].tar.bz2
    sha256sum: 54f9c8185789ab45cd46e9845a71181c5e7938e26b1b33b3f2f891f0b5cf73b6
  - filename: no-git.patch
  - filename: mavenLocal.patch
    enable: '[% !c("var/fetch_gradle_dependencies") %]'
  - filename: gen_gradle_deps_file.sh
    enable: '[% c("var/fetch_gradle_dependencies") %]'

steps:
  list_toolchain_updates:
    git_hash: 'v85.4.0'
    input_files: []
    var:
      container:
        use_container: 0
      get_android_components_version: |
        #!/bin/bash
        read -d '' p << 'EOF' || true
        if (m/^\\s*android_components_version\\s=\\s'([^']*)'/) {
          print $1;
          exit;
        }
        EOF
        perl -ne "$p" < build.gradle
      android_components_version: '[% exec(c("var/get_android_components_version")) %]'
      glean_version: '[% pc("android-components", "var/glean_version", { git_hash => "v" _ c("var/android_components_version") }) %]'
    input_files:
      - name: glean
        project: glean
        pkg_type: src

  get_gradle_dependencies_list:
    filename: 'gradle-dependencies-list-[% c("version") %].txt'
    get_gradle_dependencies_list: '[% INCLUDE build %]'
    var:
      fetch_gradle_dependencies: 1

  cargo_vendor:
    filename: '[% project %]-vendor-[% c("version") %].tar.bz2'
    input_files:
      - project: container-image
        pkg_type: build
